import com.hanxu.pojo.Books;
import com.hanxu.service.BookService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.awt.print.Book;
import java.util.List;

public class Mytest {


    @Test
    public void test(){
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        BookService bookServiceImpl = (BookService) context.getBean("BookServiceImpl");

        //List<Books> list = bookServiceImpl.queryAllBook();
        //for (Books books : list) {
        //    System.out.println(books);
        //}

        //iter 快捷键
        List<Books> books = bookServiceImpl.queryBookByName("%水%");
        for (Books book : books) {
            System.out.println(book);
        }
    }

}
